﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace PJ.Data
{
    [Serializable]
    [DataContract]
    public abstract class BaseEntityFragmentData : BaseObjectData, IEntityFragmentData
    {
        private string m_ParentID;

        [DataMember]
        public string OwnerId
        {
            get { return m_ParentID; }
            set { m_ParentID = value; }
        }

        protected BaseEntityFragmentData()
        {
        }

        public override IObjectData Init(IObjectData data)
        {
            base.Init(data);
            this.OwnerId = ((IEntityFragmentData)data).OwnerId;
            return this;
        }
        public override IObjectData Copy(IObjectData data)
        {
            base.Copy(data);
            this.OwnerId = ((IEntityFragmentData)data).OwnerId;
            return this;
        }
        public override bool IsEqual(IObjectData data)
        {
            if (base.IsEqual(data))
                if (((IEntityFragmentData)data).OwnerId == this.OwnerId)
                    return true;
            return false;
        }


    }
}
